package com.pinyougou.shop.controller;

import com.pinyougou.sellergoods.service.SpecificationOptionService;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RequestMapping("/login")
@RestController
public class Login {
    @RequestMapping("/loginName")
    public Map loginName() {
        String name = SecurityContextHolder.getContext().getAuthentication().getName();
        HashMap<String, String> map = new HashMap<>();
        map.put("loginName", name);
        return map;
    }

}
